package com.company;

import java.util.Arrays;

public class Solution1103 {
    public static int[] distributeCandies(int candies, int num_people) {
        int[] res=new int[num_people];
        int candies_give=0;
        while (candies>0)
        {
            res[candies_give%num_people]+=Math.min(++candies_give,candies);
            candies-=candies_give;
        }
        return res;
    }

    public static void main(String[] args) {
        System.out.println(Arrays.toString(distributeCandies(7, 4)));
    }
}
